package org.jeecgframework.web.material.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**   
 * @Description: 配件模板
 * @date 2015-08-19 09:51:44
 * @version V1.0   
 *
 */
@Entity
@Table(name = "part_template", schema = "")
@SuppressWarnings("serial")
public class PartTemplateEntity implements java.io.Serializable {
	//主键
	private java.lang.String id;
	//用途名称
	private java.lang.String name;
	//模板用途
	private java.lang.String application;
	//公司
	private CompanyEntity companyId;
	//备注
	private java.lang.String remark;
	
	List<ProductTemplateEntity> listPT = new ArrayList<ProductTemplateEntity>();
	
	/**
	 * @return the listPT
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "templateId")
	public List<ProductTemplateEntity> getListPT() {
		return listPT;
	}

	/**
	 * @param listPT the listPT to set
	 */
	public void setListPT(List<ProductTemplateEntity> listPT) {
		this.listPT = listPT;
	}

	/**
	 *get方法: 取得主键
	 */
	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name ="ID",nullable=false,length=32)
	public java.lang.String getId(){
		return this.id;
	}

	/**
	 *set方法: 设置主键
	 */
	public void setId(java.lang.String id){
		this.id = id;
	}

	/**
	 * @return the name
	 */
	@Column(name ="NAME")
	public java.lang.String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(java.lang.String name) {
		this.name = name;
	}

	/**
	 * @return the application
	 */
	@Column(name ="APPLICATION")
	public java.lang.String getApplication() {
		return application;
	}

	/**
	 * @param application the application to set
	 */
	public void setApplication(java.lang.String application) {
		this.application = application;
	}

	/**
	 * @return the companyId
	 */
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name ="COMPANY_ID")
	public CompanyEntity getCompanyId() {
		return companyId;
	}

	/**
	 * @param companyId the companyId to set
	 */
	public void setCompanyId(CompanyEntity companyId) {
		this.companyId = companyId;
	}

	/**
	 * @return the remark
	 */
	@Column(name ="REMARK")
	public java.lang.String getRemark() {
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(java.lang.String remark) {
		this.remark = remark;
	}
	
	
	
}
